/*
 Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 SPDX-License-Identifier: Apache-2.0
*/

@use '~design-tokens' as tokens;

.custom-table {
  box-sizing: border-box;
  overflow-x: auto;
  inline-size: 100%;

  &.use-wrapper-paddings {
    inline-size: calc(100% - 64px);
    margin-block: 0;
    margin-inline: 32px;
  }

  &-table {
    inline-size: 100%;
    box-sizing: border-box;
    border-spacing: 0;

    &:not(.use-wrapper-paddings) {
      padding-block: 0;
      padding-inline: 32px;
    }
  }

  &-cell {
    position: relative;
    box-sizing: border-box;
    border-inline-start: 1px solid tokens.$color-border-divider-default;
    border-block-end: 1px solid tokens.$color-border-divider-default;
    padding-block: 8px;
    padding-inline: 16px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    background-color: tokens.$color-background-container-content;

    &:focus {
      outline-offset: -2px;
    }

    &:first-child {
      padding-inline-start: 2px;
      border-inline-start: none;
    }
    &:last-child {
      padding-inline-end: 2px;
    }

    &.sticky-cell {
      position: sticky;

      &-last-left {
        border-inline-end: 2px solid red;
      }
      &-last-right {
        border-inline-start: 2px solid red !important;
      }
      &-pad-left {
        padding-inline-start: 32px;
      }
    }
  }

  &-selection-cell {
    inline-size: 40px;
  }

  &-sorting-header {
    padding-block: 0;
    padding-inline: 0;
    margin-block: 0;
    margin-inline: 0;
    background: none;
    border-block: none;
    border-inline: none;
    font-weight: bold;
    margin-inline-start: 2px;
  }
}

.status-trigger-button {
  background-color: initial;
  border-block: 0;
  border-inline: 0;
  border-block-end: 1px dashed;
  cursor: pointer;
  margin-block: 0;
  margin-inline: 0;
  padding-block: 0;
  padding-inline: 0;
}
